//
//  JHSVideoPlayerManager.swift
//  JHSVideo
//
//  Created by 阿飞 on 2020/12/24.
//
import UIKit
import AVFoundation
import NVActivityIndicatorView

public let JHSVideoPlayerConf = JHSVideoPlayerManager.shared

public enum JHSVideoPlayerTopBarShowCase: Int {
    case always         = 0 /// 始终显示
    case horizantalOnly = 1 /// 只在横屏界面显示
    case none           = 2 /// 不显示
}

open class JHSVideoPlayerManager {
    /// 单例
    public static let shared = JHSVideoPlayerManager()
    
    open var tintColor = UIColor.white
    
    open var loaderType = NVActivityIndicatorType.ballRotateChase
    
    open var shouldAutoPlay = true
    
    open var topBarShowInCase = JHSVideoPlayerTopBarShowCase.horizantalOnly
    
    open var animateDelayTimeInterval = TimeInterval(5)
    
    open var allowLog = false
    
    open var enableBrightnessGestures = true
    open var enableVolumeGestures = true
    open var enablePlaytimeGestures = true
    open var enablePlayControlGestures = true
    
    open var enableChooseDefinition = true
    
    internal static func asset(for resouce: JHSVideoPlayerResourceDefinition) -> AVURLAsset {
        return AVURLAsset(url: resouce.url, options: resouce.options)
    }
}
